new Carousel({
    imgs:[
        {href:"",src:""},
        {href:"",src:""},
        {href:"",src:""},
    ],
    width,
    height,
})
function Carousel({imgs,width,height}){
this.imgs = imgs;
this.width;
this.height;
this.length=imgs.length;
this.container=null;

}
$.extend(Carousel.prototype,{

    //创建DOM结构,container就是html写死的box,并设置容器的css
    createDom:function(container){
        //从数组中把fref拿出来,取出实参imgs数组;
        
        var imgs = this.imgs;

        var liHtml='',
            ihtml = '';
            this.container=$(container);//将selector包装成$对象

        for(var i=0,len=this.length;i<len;i++){
            ihtml+=`<i></i>`;
            liHtml+=`<li style="display:${(i==0)?'block':'none'}"><a href="${imgs[i].href}"><img src="${imgs[i].src}" alt=""></a></li>`;
        };
    var dom=`
    <ul style="
    list-style:none;
    position:relative;
    margin:0;
    padding:0;
    width:${this.width}px;
    height:${this.height}px;">
        ${liHtml}
    </ul>
    <div class="pages" style="width:${this.width}px;height:30px;bgckground:rgba(0,0,0,.5);position:absolute;bottom:0;"
      ${ihtml}
    </div>
    <div id="prev">&lt;</div>
    <div id="next">&gt;</div>
    `;
    //fangjincontainer中
    this.container.css({
        width:this.width,
        height:this.height,
        overflow:"hidden",
        position:"relative"
    }).html(dom);
}
})